package org.demo.patten.mediator;

/**
 * @author zhuj
 * @date 2025/3/29
 * @apiNote
 */
public class Main {
    public static void main(String[] args) {
        ChatRoomMediator mediator = new ChatRoom();
        User alice = new ConcreteUser("Alice", mediator);
        User bob = new ConcreteUser("Bob", mediator);
        User charlie = new ConcreteUser("Charlie", mediator);
        ((ChatRoom) mediator).registerUser(alice);
        ((ChatRoom) mediator).registerUser(bob);
        ((ChatRoom) mediator).registerUser(charlie);
        alice.send("大家好！");
    }
}
